<script type="text/javascript">

function isNull()
{ 
	var what = $('##what1').val();
	var where = $('#where1').val(); 
	
	alert(what+","+where);
	
	return false;
} 
	$(function(){
		
	$("#categorySuggestion").autocomplete({
		source: "model/source.php",
		minLength: 0,
		width: 210,
		//search after two characters
		select: function(event,ui){
		//set the slider position
			$("#what1").val(ui.item.id);
			return false;
		}
		
		
	});
	$("#addressPartSuggestion").autocomplete({
		source:'model/source1.php',
		minLength: 0,
		width: 210	,
		select: function(event,ui){
		//set the slider position
			$("#where1").val(ui.item.id);
			return false;
		}	
	});
	
});
</script>


<div id="headertop">
 <!-- logo --><a id="logo" class="replace" href="./"><span></span></a><!--[end] logo-->

<div><!-- login and register-->
    <div id="loginarea">
    <? if(isset($_SESSION['usid'])&&$_SESSION['usid']!=''){?>
    	<div id="loginarea"><!--đăng nhập thành công-->
        	<p class="loggedin"><!--hiển thị tên-->
            	<a title="Bạn đang đăng nhập với tài khoản: <?=$_SESSION['fullname'] ?> (<?=$_SESSION['email']?>)" href="./?action=trang-ca-nhan"><?=$_SESSION['fullname'] ?></a>
                <span id="point">
                	&nbsp;&nbsp;
                </span>
            </p><!--[end]hiển thị tên-->
            <p class="logoutbut"><!--đăng xuất-->
            	<a class="butlogout" href="#">Tho&aacute;t</a>
            </p><!--[end]đăng xuất-->
            <div class="clear"></div>
        </div>
        <? }else{ ?>
        <p class="loginbut">
            <a class="butlogin butloginaccount" href="">Đăng nhập</a>
            <a class="butlogin butregister" href="./?action=dang-ky">Đăng ký</a>
        </p>
		<? } ?>

        <form method="post" action="./?action=ket-qua-tim-kiem" > <!--"ket-qua-tim-kiem">-->


            <div id="search-region">
                <div id="search-for">
                    <label for="cat-q">
                    Tìm gì?
                    <span>(Tên địa điểm, dịch vụ...)</span>
                    </label>
                    <input id="categorySuggestion" class="search-input ui-autocomplete-input" spellcheck="false" value="<?=$_POST["what"]?>" maxlength="100" autocomplete="off" name="what" role="textbox" aria-autocomplete="list" aria-haspopup="true">
                    <input id="what1" type="hidden" value="<?=$_POST["idwhat"]?>" name="idwhat"/>
                </div>
                <div id="search-near">
                    <label for="addr-q">
                    Ở đâu?
                    <span>(Thành phố, quận, tên đường...)</span>
                    </label>
                    <input id="addressPartSuggestion" class="search-input ui-autocomplete-input ui-autocomplete-loading" spellcheck="false" value="<?=$_POST["where"]?>" maxlength="300" autocomplete="off" name="where" role="textbox" aria-autocomplete="list" aria-haspopup="true">
                    <input id="where1" type="hidden" value="<?=$_POST["idwhere"]?>" name="idwhere"/>
                </div>
                <input id="search" class="search-button" onclick="return isNull();" type="submit" value="Tìm kiếm" />
            </div
        ></form>
    </div>
    <!--[end] login and register-->
</div>
</div>